package com.aaa.javaweb.servlet;

import com.aaa.javaweb.dao.TyssDao;
import com.aaa.javaweb.until.LayTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
public class Tysscontroller {
    @Autowired
    private TyssDao tyssDao;

    @RequestMapping("querA")
    @ResponseBody
    public LayTable query(){
        List<Map> maps=tyssDao.query();
        LayTable layTable = new LayTable(maps.size(), maps);
        return layTable;
    }


    @RequestMapping("sheshi")
    @ResponseBody
    public List<Map> sheshi(Integer id){
        System.out.println(id);
            List<Map> maps=tyssDao.selectid(id);
            return maps;
    }
}
